<template>
  <div>
    <h2>我是用户</h2>
    <p>我是用户内容：嘻嘻嘻</p>
    <h2>{{ userId }}</h2>
  </div>
</template>
<script>
export default {
  name: 'routerHome',
  data() {
    return {
    }
  },
  created(){
    // $route 拿到的是处于活跃状态的路由
    console.log(this.$route);
  },
  mounted(){
    console.log('routerUser mounted');
  },
  updated(){
    console.log('routerUser updated');
  },
  // deactivated 和 activated 想使用需要 index 页面用 keep-alive 包住 router-view
  deactivated(){
    console.log('routerUser deactivated');
  },
  activated(){
    console.log('routerUser activated');
  },
  computed:{
    userId(){
      return this.$route.params.userId
    }
  },
  methods: {

  }
}
</script>
<style lang="scss" scoped>
h1,h2,h3,p{
  margin-bottom: 15px;
}
</style>
